<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> 
 <% String projectId = (String)request.getAttribute("projectId"); %>
 
 
<html:html> 
	<head>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<LINK href="../styles/sciencee.css"  type=text/css rel=stylesheet>
		<LINK href="xtree.css"  type=text/css rel=stylesheet>
		<style type="text/css"></style>
		<title>CGProject</title>
		<html:base/>
</head>
<%String project_Id = (String)request.getAttribute("projectId");%>
<%String confirm_Id = (String)request.getAttribute("confirmId");%>
<body>
	<table border="0" width="110%" cellspacing="1" id="table6" height="59" style="border: 1px solid  #C0C0C0; font-family:Tahoma; font-size:11px">
	<tr>
		<td height="25" align="left" bgcolor="#EEF2F7" colspan="7" width="85%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">&nbsp;
		<b><bean:message key="project.confirmset"/> </b>
		</td>
	</tr>
	<tr>			
			<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
			&nbsp;&nbsp;<b><bean:message key="project.confirmtype"/></b></td>	
			<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
			&nbsp;&nbsp;<b><bean:message key="project.confirmperson"/></b></td>
			<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
			&nbsp;&nbsp;<b><bean:message key="category"/></b></td>
			<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
			&nbsp;&nbsp;<b><bean:message key="project.rank"/></b><br></td>
			<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
			&nbsp;&nbsp;<b></b><br></td>
			
	</tr>

	<logic:iterate id="element" name="Confirms">
		<logic:iterate id="element1" name="element">
		<logic:equal name="element1" property="confirmId" value="<%=confirm_Id%>">
		<html:form action="/modConfirm">
		<html:hidden property="id" value="<%=confirm_Id%>"/>
		<tr>
			<logic:notEqual name="element1" property="rowspan" value="0">
				<td height="25" align="left" width="20%"  rowspan="<bean:write name="element1" property="rowspan"/>" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<bean:write name="element1" property="typeName"/></td>	
			</logic:notEqual>
			

				<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<html:select property="reguser" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px">
					<html:options  collection="Regusers"
								   property="regUserId"
								   labelProperty="regName"/>
				</html:select></td>

				
				<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<bean:write name="element1" property="category.categoryName"/></td>
				<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<bean:write name="element1" property="rank"/><br></td>
			
			
				<td height="25" align="left" width="20%"  style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<html:submit><bean:message key="basicmodify"/></html:submit></td>	

		</tr>
		</html:form>
		</logic:equal>
		<logic:notEqual name="element1" property="confirmId" value="<%=confirm_Id%>">
		<tr>
			<logic:notEqual name="element1" property="rowspan" value="0">
				<td height="25" align="left" width="20%"  rowspan="<bean:write name="element1" property="rowspan"/>" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<bean:write name="element1" property="typeName"/></td>	
			</logic:notEqual>
				<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<bean:write name="element1" property="reguser.regName"/></td>
				<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<bean:write name="element1" property="category.categoryName"/>(<bean:write name="element1" property="category.categoryType"/>)</td>
				<td height="25" align="left" width="20%" style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
				&nbsp;&nbsp;<bean:write name="element1" property="rank"/><br></td>
			
			
				<td height="25" align="left" width="20%"  style="border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; font-family:Verdana; font-size:11px">
		
				&nbsp;&nbsp;<html:link page="/setConfirm.do" paramId = "confirmId" paramName="element1" paramProperty="confirmId">[<bean:message key="basicmodify"/>]</html:link>&nbsp;&nbsp;
				<html:link page="/delConfirm.do" paramId="confirm_Id" paramName="element1" paramProperty="confirmId" onclick="return   confirm('You will delete all related ConfirmSet!')">[<bean:message key="delete"/>]</html:link></td>
		</tr>
		</logic:notEqual >
		</logic:iterate>
		
	</logic:iterate>
	</table>
	<html:form action="/addConfirm">
	<html:hidden property="projectId" value="<%=project_Id%>"/>
	<table border="0" width="110%" cellspacing="0" id="tabletable" height="59" cellpadding="0">
		<tr>
			<td height="25" width="5%"align="left" bgcolor="#EEF2F7" style="border-left:1px dotted #C0C0C0; border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px">&nbsp;
			<font color="#990000"><bean:message key="project.addconfirmrank"/></font>
			</td>
			<td height="25" width="15%" bgcolor="#EEF2F7" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px"><bean:message key="confirmtype"/></td>
			<td height="25" width="15%" bgcolor="#EEF2F7" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px"><bean:message key="category"/></td>
			<td height="25" width="15%" bgcolor="#EEF2F7" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px"><bean:message key="project.confirmperson"/></td>		
		</tr>
		<tbody id="tbDetailUsed">
		<tr>
			<td height="20" width="5%" style="border-left:1px dotted #C0C0C0; border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px" align="center"><input type="checkbox"  disabled name="record_select" ></td>
			<td height="20" width="15%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			<html:select property="type" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px">
					<html:option value="Task"><bean:message key="task"/></html:option>
					<html:option value="Make"><bean:message key="make"/></html:option>
					<html:option value="Shot"><bean:message key="shot"/></html:option>
					<html:option value="Element"><bean:message key="element"/></html:option>
			</html:select></td>
			<td height="20" width="15%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			<html:select property="category" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px">
					<html:options  collection="Categories"
								   property="categoryId"
								   labelProperty="categoryName"/>
			</html:select></td>
			<td height="20" width="15%"  style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px">
			<html:select property="reguser" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px">
					<html:options  collection="Regusers"
								   property="regUserId"
								   labelProperty="regName"/>
				</html:select></td>
		</tr>	
		</tbody>
		<tr>
				<td height="20" width="110%" style="border-left:1px dotted #C0C0C0; border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px" colspan="5">
				<html:submit><bean:message key="submit"/></html:submit>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button"  value="IncreaseClause" onClick="addDetailProcess();" style="font-family: Tahoma; font-size: 11px">
				<input type="button" value="DeleteClause" style="font-family: Tahoma; font-size: 11px" onclick="delDetailProcess()"></td>
			</tr>
		</table>
		<table id="tbDetailPrepare" style="display:none" cellspacing="0" cellpadding="0">
			<tr>
				<td height="20" width="5%" style="border-left:1px dotted #C0C0C0; border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px" align="center"><input type="checkbox"  name="record_select" ></td>
			<td height="20" width="15%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			<html:select property="type" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px">
					<html:option value="Task"><bean:message key="task"/></html:option>
					<html:option value="Make"><bean:message key="make"/></html:option>
					<html:option value="Shot"><bean:message key="shot"/></html:option>
					<html:option value="Element"><bean:message key="element"/></html:option>
			</html:select></td>
			<td height="20" width="15%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			<html:select property="category" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px">
					<html:options  collection="Categories"
								   property="categoryId"
								   labelProperty="categoryName"/>
			</html:select></td>
			<td height="20" width="15%"  style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; font-family:Tahoma; font-size:11px">
			<html:select property="reguser" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px">
					<html:options  collection="Regusers"
								   property="regUserId"
								   labelProperty="regName"/>
				</html:select></td>
			</tr>	
	
		</table>
		
	
	
	</html:form>

	</body>
</html:html>
<script language="javascript">

function addDetailProcess(afterRowIndex)		//增加明细
{
	
	
	var alltbDetailUsed = document.all("tbDetailUsed").rows;
	
	var theFirstSelectedDetail;
	if (afterRowIndex==null)
	{
	  theFirstSelectedDetail=alltbDetailUsed.length-2;
	}
	else theFirstSelectedDetail=afterRowIndex;
	var newRow = document.all("tbDetailPrepare").rows[0].cloneNode(true);
	var desRow = alltbDetailUsed[theFirstSelectedDetail+1];
//		desRow.parentElement.insertBefore(newRow,desRow );
	desRow.parentElement.appendChild(newRow);
	
	return alltbDetailUsed.length;
}

function delDetailProcess()						//删除明细
{
	var tag="";
	var alltbDetailUsed = document.all("tbDetailUsed").rows;
	for(var ii=0;ii<alltbDetailUsed.length;ii++)
	{
		
		if (alltbDetailUsed[ii].all("record_select").checked==true)
		{
			tag="true";
			break;		
		}
		else
		{
			tag="false";
		}
	}
	if(tag=="false")
	{
		alert("Please select a clause!");
	}
	else
	{
		for(var i=0;i<alltbDetailUsed.length;i++)
		{
			if (alltbDetailUsed[i].all("record_select").checked==true)
			{
				document.all("tbDetailUsed").deleteRow(i);
				i=i-1;
			}
		}
	}
}

</script>

